package com.zzj.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zzj.entity.User;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author zzj
 * @since 2023-05-12
 */
public interface IUserService extends IService<User> {

    /**
     * 是否为超级管理员
     * @param token  Token
     * @return boolean
     */
    boolean isSuperAdmin(String token);
    /**
     * 是否为管理员
     * @param token  Token
     * @return boolean
     */
    boolean isAdmin(String token);

    User findUserByUsername(String username);

    User findUserByUsernamePassword(String username,String password) throws Exception;

    User findUserByEmail(String email);


    boolean setUserStatus(String username,int status);


    int updateAvatar(String oldAvatar,String newAvatar);

    int updateUsername(String oldUsername,String newUsername);

    boolean setUserEmail(String username,String email);

    boolean setUserPassword(String username,String password) throws Exception;
}
